<?php 
interface CategoriesInterface
{
    public function getCurrentCategorie($lan);
    public function is_all();
    public function getCurrentCategorieID();
}
class Categories implements CategoriesInterface
{
    private $cate = -1;
    const ALL = -1;
    const  ACCOMMODATION = 1;
    const   TRANSPORT = 2;
    const   SHOPPING = 3;
    const   ATTRACTION =4;
    const   FOOD = 5;
    private static  $ALL = ["en"=>"ALL","cn"=>"All"];
    private static  $ACCOMMODATION = ["en"=>"Accommodation","cn"=>"住宿"];
    private static  $TRANSPORT = ["en"=>"Transport","cn"=>"住宿"];
    private static  $SHOPPING = ["en"=>"Shopping","cn"=>"住宿"];
    private static  $ATTRACTION = ["en"=>"Attraction","cn"=>"住宿"];
    private static  $FOOD = ["en"=>"Food & Beverage","cn"=>"住宿"];
    public function __construct($cate_id=-1) 
    {
        $this->set_category_type($cate_id);
    }
    public function getCurrentCategorieID()
    {
        return $this->cate;
    }
    public function set_category_type($cate_id)
    {
        switch($cate_id)
        {
            case Categories::ACCOMMODATION:
                $this->cate = Categories::ACCOMMODATION;
                break;
            case Categories::TRANSPORT:
                $this->cate = Categories::TRANSPORT;
                break;
            case Categories::SHOPPING:
                $this->cate = Categories::SHOPPING;
                break;
            case Categories::ATTRACTION:
                $this->cate = Categories::ATTRACTION;
                break;
            case Categories::FOOD:
                $this->cate = Categories::FOOD;
                break;
            default:
                $this->cate = Categories::ALL;
                break;
        }
       
    }
    public function get_category_type()
    {
        return $this->cate;
    }
    public static function getCategorieName($cate_id, $lan)
    {
        switch($cate_id)
        {
            case Categories::ACCOMMODATION:
                return Categories::$ACCOMMODATION[$lan];
                break;
            case Categories::TRANSPORT:
                return Categories::$TRANSPORT[$lan];
                break;
            case Categories::SHOPPING:
                return Categories::$SHOPPING[$lan];
                break;
            case Categories::ATTRACTION:
                return Categories::$ATTRACTION[$lan];
                break;
            case Categories::FOOD:
                return Categories::$FOOD[$lan];
                break;
            default:
                return Categories::$ALL[$lan];
                break;
        }
    }
    public function getCurrentCategorie($lan)
    {
        return $this->getCategorieName($this->cate, $lan);
    }
    
     public function is_all()
     {
        return $this->cate  == Categories::ALL ;
     }
}
?>